export let SavedData = {};

try {
    if(FileLib.exists("./config/ChatTriggers/modules/BabyzombieAddons/config/data.json")) 
    SavedData = Object.assign(SavedData,JSON.parse(FileLib.read("./config/ChatTriggers/modules/BabyzombieAddons/config/data.json")));
} catch (error) {}

register("step", () => {
    FileLib.write("./config/ChatTriggers/modules/BabyzombieAddons/config/data.json",JSON.stringify(SavedData,null,4),true);
}).setDelay(60)
register("gameUnload", () => {
    FileLib.write("./config/ChatTriggers/modules/BabyzombieAddons/config/data.json",JSON.stringify(SavedData,null,4),true);
})

export function AddData(name,value) {
    if(SavedData[name] === undefined) SavedData[name] = value;
}